#pragma once

#include "index-tree.h"


namespace book
{

// 一本书的最高层抽象
// 其它所有有关书的概念都放在这里面
class Book
{
public:
    Book() {}

    Book(const Book &) = delete;

    Book(Book &&b) noexcept
        : srcDir_(std::move(b.srcDir_))
        , indexTree_(std::move(b.indexTree_))
        , generatedDir_(std::move(b.generatedDir_)) {}

    Book &operator=(const Book &) = delete;

    Book &operator=(Book &&b) noexcept {
        srcDir_ = std::move(b.srcDir_);
        indexTree_ = std::move(b.indexTree_);
        generatedDir_ = std::move(b.generatedDir_);
        return *this;
    }

    const fs::path &srcDir() const {
        return srcDir_;
    }

    void setSrcDir(const fs::path &srcDir) {
        srcDir_ = srcDir;
    }

    const IndexTree &indexTree() const {
        return indexTree_;
    }

    void setIndexTree(IndexTree &&indexTree) {
        indexTree_ = std::move(indexTree);
    }

    const fs::path &generatedDir() const {
        return generatedDir_;
    }

    void setGeneratedDir(const fs::path &generatedDir) {
        generatedDir_ = generatedDir;
    }

    fs::path imgFilePath(const std::string &uriPath) const;

private:
    fs::path srcDir_;
    IndexTree indexTree_;
    fs::path generatedDir_;
};

} // namespace book
